import { reactive } from 'vue'
import http from "@/common/http.js"

let gp

const store = reactive({
	menuInfo: uni.getMenuButtonBoundingClientRect(),
})

function defineGetters (getters) {
	let object = {}
	
	for (let prop in getters) {
		object[prop] = {
			get: getters[prop]
		}
	}
	
	let properties = Object.defineProperties({}, object)
	for (let prop in properties) {
		properties[prop]
	}
	
	return properties
}

function initStore (app) {
	gp = app.config.globalProperties
	gp.$store = store
}

export { initStore } 